import Vue from 'vue';
import Router from 'vue-router';
import HomePage from '@/page/index';
import Login from '@/page/login/login';
import ApplyerInfo from '@/page/corp/employee/applyerInfo';
import Register from '@/page/login/register';
import MainPage from '@/page/mainPage';
import Company from '@/page/company';
import ChatRoom from '@/page/chat/chatRoom';
import CompanyInfo from '@/page/companyInfo';
import QuestionAssign from '@/page/quizzes/questionAssign';
import Quizz from '@/page/quizzes/applyer/quizz';
import QuizzDetail from '@/page/quizzes/applyer/quizzDetail';
import corpAdmin from './corp.admin';
import corpEmployee from './corp.employee';
import applyer from './applyer';
import quizzesApplyer from './quizzes/quizzes.applyer';
import quizzesCorp from './quizzes/quizzes.corp';
import quizzesAdmin from './quizzes/quizzes.admin';
import sysAdmin from './sys.admin';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HomePage',
      component: HomePage,
      redirect: '/mainPage',
      children: [
        {
          path: '/login',
          name: 'Login',
          component: Login,
        },
        {
          path: '/register',
          name: 'Register',
          component: Register,
        },
        {
          path: '/mainPage',
          name: 'MainPage',
          component: MainPage,
        },
        {
          path: '/company',
          name: 'Company',
          component: Company,
        },
        {
          path: '/company/companyInfo',
          name: 'CompanyInfo',
          component: CompanyInfo,
        },
        {
          path: '/chat',
          name: 'ChatRoom',
          component: ChatRoom,
        },
        {
          path: '/empl/applyerInfo',
          name: 'ApplyerInfo',
          component: ApplyerInfo,
        },
        {
          path: '/quizz/assign',
          name: 'QuestionAssign',
          component: QuestionAssign,
        },
        {
          path: '/quizz/applyer/quizz',
          name: 'Quizz',
          component: Quizz,
        },
        {
          path: '/quizz/applyer/detail',
          name: 'QuizzDetail',
          component: QuizzDetail,
        },
        corpAdmin, corpEmployee, applyer, quizzesApplyer, quizzesCorp, sysAdmin, quizzesAdmin,
      ],
    },
  ],
});
